package cn.acrdpm.controller;

import cn.acrdpm.constant.ServerResponse;
import cn.acrdpm.entity.Mail;
import cn.acrdpm.producer.MqProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *  测试邮件的消息队列是否成功
 * @author 张敏
 * @date 2021/3/11
 */
@RequestMapping("/mail")
@RestController
public class TestMailController {

    @Autowired
    MqProducer mqProducer;

    @PostMapping("/send")
    public ServerResponse sendMail(@RequestBody Mail mail){
        return mqProducer.sendMail(mail);
    }
}
